﻿--
--
IF EXISTS (SELECT name FROM sysobjects WHERE name = 'dsZeusPackageUnstored' AND type = 'P')
BEGIN
  DROP PROCEDURE dsZeusPackageUnstored
END
GO

-- HU - Utántöltő lista
-- EN - Packages, palettes for Refill
--
CREATE PROCEDURE dsZeusPackageUnstored
(@AccessToken INTEGER)
 AS
BEGIN
  DECLARE
    @Err INTEGER,
    @Rows INTEGER,
    @UserID INTEGER,
    @Lang NVARCHAR(10)

  EXEC @Err = spAccessTokenCheck @AccessToken, @UserID OUTPUT, @Lang OUTPUT

  IF (@Err != 0)
    GOTO __ERROR__


  -- HU - Visszaadja az adatokat
  -- EN - Get the package details
  --
  SELECT Code, ArticleCode, ArticleName, CAST(Expired as DATE) Expired, LocationCode, Quantity, UnitCode, N'' Notes
    FROM ZeusPackage
   WHERE LocationCode IS NULL
    
-- Well done.
--
  RETURN(0)

-- We have a problem !
--
__ERROR__:
  RETURN(1)
END
GO
